package db

import (
	log "github.com/sirupsen/logrus"
	"src/db/db_modle"
	"src/error_msg"
)

// 获取用户信息
func GetInfoBaseById(uid uint, logId string) (*db_modle.InformationBase, error) {
	orm := GetMysqlOrm()
	defer orm.Close()
	user := &db_modle.InformationBase{}
	result := orm.Where("user_id = ?", uid).Find(&user)
	if e := result.Error; e != nil {
		ne := error_msg.InformationNotFoundError
		log.Error(ne.Error(), logId)
		return &db_modle.InformationBase{}, ne
	}
	return user, nil
}
